           package com.java.diagnostics.visualizer.impl.factory;
           
           import java.util.logging.LogManager;
           import java.util.logging.Logger;
           
           public class LogFactory
           {
             private static LogManager masterLogManager = null;
           
             private static LogManagerFactory logManagerFactory = null;
           
             public static void setMasterLogManagerFactory(LogManagerFactory lmf)
             {
               logManagerFactory = lmf;
               masterLogManager = lmf.getLogManager();
             }
           
             public static Logger getTrace(Class<?> classToTrace)
             {
               if (masterLogManager == null) {
                 setMasterLogManagerFactory(new DefaultLogManagerFactory());
               }
           
               Logger logger = masterLogManager.getLogger(classToTrace.getName());
               if (logger == null) {
                 logger = Logger.getLogger(classToTrace.getName());
               }
               return logger;
             }
           
             public static void reset()
             {
               if (logManagerFactory == null) {
                 setMasterLogManagerFactory(new DefaultLogManagerFactory());
               }
               logManagerFactory.reset();
               masterLogManager = logManagerFactory.getLogManager();
             }
           }

